home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / pxewin.zip / PXREC.HPP < prev    next >
C/C++ Source or Header  |  1992-02-06  |  2KB  |  80 lines

  1. // PXEWIN - (C) Copyright 1992 by Beam Engineering, INC.
  2.  
  3. // PXREC.HPP //
  4.  
  5. // Contents ----------------------------------------------------------------
  6. //
  7. //    PXRec.  This module contains the PXRec class for interfacing the
  8. //    engine to the PDOX Engine record related functions.
  9. //
  10. // End ---------------------------------------------------------------------
  11.  
  12. // External Reference Name for this Header ---------------------------------
  13.  
  14. #ifndef PXREC_HPP
  15.     #define PXREC_HPP
  16.  
  17. // Interface Dependencies --------------------------------------------------
  18.  
  19. #ifndef PXEOBJ_CPP
  20.     #include "pxeobj.cpp"
  21. #endif // PXEOBJ_CPP //
  22.  
  23. // End ---------------------------------------------------------------------
  24.  
  25. // class PXRec //
  26.  
  27. _CLASSDEF(PXRec)
  28. class PXRec:public PXEngObject{
  29. private:
  30.     virtual const Pchar streamableName()
  31.     const                    /* Defines the streamable
  32.                            name for this class. */
  33.     {
  34.         return "PXRec";
  35.     }
  36. protected:
  37.     virtual Pvoid read(Ripstream);        /* Read persistant object */
  38.     virtual void write(Ropstream);        /* Write persistant object */
  39.     PXRec(StreamableInit):            /* Persistant object
  40.                            constructor */
  41.         PXEngObject(streamableInit)
  42.     {
  43.  
  44.     }
  45. public:
  46.     PXRec(PPXEngObject my_engobj);        /* Copies parent object on
  47.                            construction */
  48.     static PTStreamable build();        /* Build persistant object */
  49.     virtual ~PXRec();
  50.     int Get();                /* Get current record */
  51.     int Update();                /* Updata the current record
  52.                            with tx buffer data */
  53.     int RecPrev();                       /* Go to previous record */
  54.     int RecNext();                /* Go to next record */
  55.     int GoTo(RECORDNUMBER recNum);        /* Go to a record */
  56.     virtual void PXError(int org);        /* PXRec error handler */
  57. };
  58.  
  59. // Description -------------------------------------------------------------
  60. //
  61. //    This class contains constructors, destructors and members needed to
  62. //    access a record in a Paradox table.  It uses PXENGINE function calls.
  63. //
  64. // End ---------------------------------------------------------------------
  65.  
  66. // Define inserters and extractors for persistant objects:
  67.  
  68. inline Ripstream operator >> (Ripstream is,RPXRec cl)
  69.     {return is >> (RTStreamable)cl;}
  70.  
  71. inline Ripstream operator >> (Ripstream is,RPPXRec cl)
  72.     {return is >> (RPvoid)cl;}
  73.  
  74. inline Ropstream operator << (Ropstream os,RPXRec cl)
  75.     {return os << (RTStreamable)cl;}
  76.  
  77. inline Ropstream operator << (Ropstream os,PPXRec cl)
  78.     {return os << (PTStreamable)cl;}
  79.  
  80. #endif // PXREC_HPP //